package com.cn.wanxi.model;

public class ResultModel {
    private Integer code;
    private String msg;
    private Integer count;
    private Object data;
    private static ResultModel resultModel;

    private ResultModel() {
    }

    public static ResultModel getResult(String msg) {
        if (resultModel == null) {
            synchronized (ResultModel.class) {
                if (resultModel == null) {
                    resultModel = new ResultModel();
                    resultModel.setMsg(msg);
                }
            }
        }
        return resultModel;
    }

    public static ResultModel getResult(Integer count) {
        if (resultModel == null) {
            synchronized (ResultModel.class) {
                if (resultModel == null) {
                    resultModel = new ResultModel();
                    resultModel.setCount(count);
                }
            }
        }
        return resultModel;
    }

    public static ResultModel getResult(Object object) {
        if (resultModel == null) {
            synchronized (ResultModel.class) {
                if (resultModel == null) {
                    resultModel = new ResultModel();
                    resultModel.setData(object);
                }
            }
        }
        return resultModel;
    }
//    public ResultModel(Object data) {
//        this.data = data;
//    }
//
//    public ResultModel(Integer count) {
//        this.count = count;
//    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
